Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

Play with a friend feature #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

guillaumepotier
Copy link

Hi @emils,

First of all, thanks for your great 2048 multiplayer version! I'm using it a lot and having much fun with colleagues :)

I'm implementing a "Play with a friend" feature, much needed for us (currently, we savagely refresh browsers to try to find against each others..) on your code. Here is my first commit.
Here, basically, what I have done:

  • Now users connect to sockJS on dom loaded, they trigger different events:
    • 'register' -> register their user-friendly 4 digits hash on the server, under their io connexion
    • 'play-friend' -> send a 4 digits hash of a friend, to launch a game against him
    • 'find-opponent' -> find a random opponent waiting too, the current feature
  • I reordered some code parts into function to be able to mutualize them in random mode or find friend mode.
  • I showed the stats all time, I find it quite fun. I distinguish now players on plateform, and waiters that await for a random match

This is working for me right now.

Now, what I'd like if possible:

  • your feedback on that (the principle)
  • eventually clone my work and test it, and have your feedback
  • if you like it, what should be done on this branch before you merge it

Best :)

@es
Copy link
Owner

es commented Apr 24, 2014

Wow this is awesome! I'll take a look at it when I get home tonight 😃

@guillaumepotier
Copy link
Author

Great,

In the meantime, this is what I think it is still needed on this branch, feel free tonight to add your checkboxes ;)

  • handle not found hash in the client (currently, there is no warning or whatsoever for the user)
  • better UI for new vex modals (nice lib btw)
  • variabilized sockjs url and game time in a distant config file
  • maybe some needed code refacto on both server and client
  • use supervisor to run server
  • remove indistinct letters from hash generation ? (eg: l and i, O and 0, ..)
  • handle hash conflict (rare, especially if hash has a faire length, but might occur ^^)

Best

@guillaumepotier guillaumepotier changed the title Play a friend feature Play with a friend feature Apr 24, 2014
@guillaumepotier
Copy link
Author

Hi there,

I suppose you did not had time to have a look yet at my implementation. This is still a mess, but I think I have yet something quite functional here: http://guillaumepotier.github.io/2048-multiplayer/

Best

- added config file to handle different configs (local / prod). Removed ambiguous characters from hashes. Need to fix now actions after game over.

- added missing redis from package.json for server. Fixed indent. need to seriously work out new game after first finished game

- some more hacks not very UX/UI friendly to make successive games working.. need better implem

- variabilized get server info
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants